<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:include="header::header" />
<body>
	<div id="dgtoolbar">
		<a id="newbtn" href="#" class="easyui-linkbutton" iconCls="icon-add" plain="true">新增</a>
		<a id="editbtn" href="#" class="easyui-linkbutton" iconCls="icon-edit" plain="true">编辑</a>
		<a id="deletebtn" href="#" class="easyui-linkbutton" iconCls="icon-remove" plain="true">删除</a>
		<a id="reloadbtn" href="#" class="easyui-linkbutton" iconCls="icon-reload" plain="true">刷新</a>
		<a id="foldbtn" href="#" class="easyui-linkbutton" iconCls="icon-down" plain="true">折叠</a>
		<a id="unfoldbtn" href="#" class="easyui-linkbutton" iconCls="icon-up" plain="true">展开</a>
	</div>
	<table id="tdg" class="easyui-treegrid" data-options="url:'treeQuery',idField:'iid',treeField:'cname',lines:'true',animate:'true',rownumbers:'true',singleSelect:'true',method:'post',toolbar:'#dgtoolbar',fit:'true'">
		<thead>
			<tr>
				<th data-options="field:'iid'" checkbox="true" />
				<th data-options="field:'cname'" width="200" align="left" halige="center">菜单名称</th>
				<th data-options="field:'curl'" width="200" align="left" halige="center">地址</th>
				<th data-options="field:'isshow'" width="60" align="center">是否显示</th>
				<th data-options="field:'isort'" width="60" align="center">排序</th>
				<th data-options="field:'cparam'" halign="center">传递参数</th>
			</tr>
		</thead>
	</table>
	<div id="dlg" class="easyui-dialog" title="操作" style="padding: 5px" data-options="buttons: '#dlg-buttons',closed:'true',modal:true">
		<form id="dataform" method="post" enctype="multipart/form-data">
			<table>
				<tr>
					<td><input name="iid" id="iid" type="hidden"></input>
				</tr>
				<tr>
					<td>上级菜单:</td>
					<td><input name="ipid" id="ipid" class="easyui-combotree" data-options="panelHeight:'auto'" style="width: 150px" required="required" /></td>
				</tr>
				<tr>
					<td>菜单名称:</td>
					<td><input name="cname" class="easyui-textbox" style="width: 150px" required="required" /></td>
				</tr>
				<tr>
					<td>url地址:</td>
					<td><input name="curl" class="easyui-textbox" style="width: 150px" /></td>
				</tr>
				<tr>
					<td>是否显示:</td>
					<td><!-- <input name="isshow" class="easyui-combobox" data-options="data:[],valueField:'value',textField:'label',panelHeight:'auto'" style="width: 200px" required="required" /> -->
						<select name="isshow" class="easyui-combobox" style="width:150px" data-options="panelHeight:'auto',required:'true'">
							<option value="0">显示</option>
							<option value="1">不显示</option>
						</select>
					</td>
				</tr>
				<tr>
					<td>传递参数:</td>
					<td><input name="cparam" class="easyui-textbox" style="width: 150px" /></td>
				</tr>
				<tr>
					<td>图标名称:</td>
					<td><input id="cicon" name="cicon" class="easyui-combobox" style="width: 150px" data-options="valueField:'value',textField:'label',panelHeight:180,data:Common.icons"></input></td>

				</tr>
				<tr>
					<td>排序:</td>
					<td><input name="isort" class="easyui-numberspinner" style="width: 150px" data-options="min:0,max:1000,editable:false" required="required" /></td>
				</tr>
			</table>
		</form>
	</div>
	<div id="dlg-buttons">
		<a id="dlg-savebtn" href="javascript:void(0)" style="width: 50" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
		<a id="dlg-closebtn" href="javascript:void(0)" style="width: 50" class="easyui-linkbutton" iconCls="icon-no">关闭</a>
	</div>
</body>
<script type="text/javascript">
	function subNewHandler() {
		getAllDataGridData();
	}
	function subEditHandler() {
		getAllDataGridData();

	}
	function getAllDataGridData() {
		var menuJson = $("#tdg").treegrid("getData");
		$("#ipid").combotree("loadData", menuJson);
	}
	;
    var data=Common.icons;
</script>
<script type="text/javascript" th:src="@{/common/common.js}"></script>
<script type="text/javascript" th:src="@{/menu/menu.js}"></script>
</html>